/*
 * Copyright (c) 2024 dragonSaberCaptain.All rights reserved.
 * 当前项目名:wisdom-parent
 * 当前模块名:auth-core
 * 当前文件的权限定名:com.wisdom.AuthCoreApp
 * 当前文件的名称:AuthCoreApp.java
 * 当前文件的类名:AuthCoreApp
 * 上一次文件修改的日期时间:2024/1/19 下午1:31
 *
 */

package com.wisdom;

import com.wisdom.base.dto.SystemInfo;
import com.wisdom.base.enums.DateTimeEnum;
import com.wisdom.tools.datetime.DateUtilByZoned;
import com.wisdom.tools.system.SpringContextUtil;
import com.wisdom.tools.system.SystemUtil;
import lombok.extern.slf4j.Slf4j;
import org.jboss.logging.MDC;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ApplicationContext;

@Slf4j
@SpringBootApplication(scanBasePackages = "com.wisdom.*", exclude = {DataSourceAutoConfiguration.class})
@EnableDiscoveryClient
public class AuthCoreApp {
    public static void main(String[] args) {
        MDC.put("BIZ_ID", DateUtilByZoned.getDateTime(DateTimeEnum.DATETIME_PATTERN_MILLI_UN));
        ApplicationContext context = SpringApplication.run(AuthCoreApp.class, args);
        SpringContextUtil.setApplicationContext(context);
        SystemInfo systemInfo = SystemUtil.printSystemInfo(AuthCoreApp.class);
        String startUpInfo = systemInfo.getSimpleName() + " " + systemInfo.getEnvironmentActive() + " " + systemInfo.getPort() + " start successful !!!";
        System.out.println(startUpInfo);
        log.info(startUpInfo);
    }
}
